<template>
  <div>
    <!-- <div>count={{ count }}</div> -->
    <!-- 不可以直接修改父组件的数据，遵循单向数据流 -->
    <!-- <button @click="count++">+1</button> -->
    <!-- <button @click="$emit('add')">+1</button>
    <button @click="$emit('addN', 3)">+N</button> -->
    <div>count={{ value }}</div>
    <button @click="$emit('input', 1)">+1</button>
    <button @click="$emit('input', 3)">+N</button>
    <input ref="inputRef">
  </div>
</template>

<script>
export default {
  name: 'Son',
  props: {
    // count: {
    //   type: Number,
    //   required: true
    // }
    value: {
      type: Number,
      required: true
    }
  },
  methods: {
    focus() {
      this.$refs.inputRef.focus()
    }
  }
}
</script>

<style>

</style>
